<?php
/* SVN FILE: $Id: market.php 171 2009-08-24 21:53:50Z supersmashbrothers $ */
/**
* ibMarket 2
* IP.Board 3.0
* ibMarket tab in member profile
*
* @author $Author: supersmashbrothers $
* @copyright $Copyright$
* @version $Revision: 171 $
* @lastrevision $Date: 2009-08-24 21:53:50 +0000 (Mon, 24 Aug 2009) $
* @modifiedby $LastChangedBy: supersmashbrothers $
* @lastmodified $LastChangedDate: 2009-08-24 21:53:50 +0000 (Mon, 24 Aug 2009) $
* @filesource $URL: http://ipb-ibmarket.googlecode.com/svn/ibmarket2/trunk/admin/applications/members/sources/tabs/market.php $
*/

if ( ! defined( 'IN_IPB' ) )
{
	print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
	exit();
}

class profile_market extends profile_plugin_parent
{
	/**
	 * Feturn HTML block
	 *
	 * @access	public
	 * @param	array		Member information
	 * @return	string		HTML block
	 */
	public function return_html_block( $member=array() ) 
	{
		if ( ! is_array( $member ) OR ! count( $member ) )
		{
			return '';
		}
		
		$this->registry->class_localization->loadLanguageFile( array( 'public_market' ), 'ibmarket' );
		
		$this->cache->getCache(array('market_category','market_items','market_plugin','market_wages'));
		
		if(!class_exists('marketRegistry'))
		{
			require_once( IPSLib::getAppDir('ibmarket')."/sources/marketRegistry.php");
			ipsRegistry::member()->setProperty('market_deduct', 1);
			marketRegistry::__setup();
		}
		
		return $this->registry->getClass('output')->getTemplate('ibmarket')->memberProfileTab($member, marketRegistry::getInventoryItem($member['member_id']));
	}
}


?>